# 函数用于提高代码的复用性
# 减少重复的代码


# len()用于统计长度
name = "rxy5566"
length = len(name)
print(length)

str1 = "rxy3344"
str2 = "whoami"
str3 = "qwert"
count = 0
for i in str1:
    count += 1
print(f"字符串str1长度为:{count}")


def my_len(data):
    count = 0
    for i in data:
        count += 1
    print(f"字符串{data}长度为：{count}")


my_len(str1)
my_len(str2)
my_len(str3)
